package org.hdz.changelanguage;

import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;

/**
 * Created by hdz on 2019/1/5.
 */

public class UserConfig {
    public static void setLanguageId(Context context, int langId) {
        Log.d("UserConfig", "============"+langId);
        SharedPreferences preferences = context.getSharedPreferences("config", Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = preferences.edit();
        editor.putInt("LanguageId", langId);
        editor.commit();
    }

    public static int getLanguageId(Context context) {
        SharedPreferences preferences = context.getSharedPreferences("config", Context.MODE_PRIVATE);
        return preferences.getInt("LanguageId", 0);
    }
}
